﻿
Partial Class WebForm_ManageTrainingCourse_QueryTrainingCourse
    Inherits System.Web.UI.UserControl

    Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
        If Not IsPostBack Then

        End If
    End Sub

#Region "Delegate"

    Public Event SelectedIndexChanged(ByVal source As Object, ByVal e As EventArgs)

    '按下編輯
    Protected Sub GV_SelectedIndexChanged(ByVal sender As Object, ByVal e As System.EventArgs) Handles GV.SelectedIndexChanged
        RaiseEvent SelectedIndexChanged(Me, New EventArgs)
    End Sub

    Public Event GVDelete(ByVal source As Object, ByVal e As EventArgs)

    '按下刪除
    Protected Sub lbtnDelete_Click(ByVal sender As Object, ByVal e As System.EventArgs)
        RaiseEvent GVDelete(Me, New EventArgs)
    End Sub

#End Region

  
    Protected Sub ddlGroupType_DataBound(ByVal sender As Object, ByVal e As System.EventArgs) Handles ddlGroupType.DataBound
        ddlGroupType.Items.Insert(0, MyObj.GetDDLPleaseChooseItem)
    End Sub

    Protected Sub btnQuery_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles btnQuery.Click
        ObjectDataSource1.SelectParameters("GroupType").DefaultValue = ddlGroupType.SelectedValue
    End Sub

End Class

Partial Class WebForm_ManageTrainingCourse_QueryTrainingCourse

    Public Sub InitData()

        GV.DataSourceID = ObjectDataSource1.ID
        GV.DataBind()

    End Sub

#Region "Property"

    Public ReadOnly Property SelectedID() As String
        Get
            If Me.GV.SelectedRow Is Nothing Then
                Return 0
            Else
                Return Me.GV.DataKeys(Me.GV.SelectedIndex).Value
            End If

        End Get
    End Property

#End Region

End Class
